package com.lhc.service.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

public class ReadAndWriteDetachDataSource  extends AbstractRoutingDataSource {
	private static final Logger log = LoggerFactory.getLogger(ReadAndWriteDetachDataSource.class);
	@Override
	protected Object determineCurrentLookupKey() {
		Object o = DynamicDataSourceBinding.getCurrentDataSourceName();
		if(log.isDebugEnabled()){
			log.debug("::::::::::::::::::>>获得连接："+o+",线程："+ Thread.currentThread());
		}
		return o;
	}
}
